package com.yootoo.extpmml.dsl

class AdapterRequest {
    def _url = ''
    Closure<String> _urlClosure
    def _header = new LinkedHashMap<String, String>()
    Closure<Map<String, String>> _headerClosure
    def _method = 'POST'
    boolean _trace = true

    def url(String url) {
        _url = url
        return this
    }

    def url(Closure urlClosure) {
        _urlClosure = urlClosure
        return this
    }

    def header(Map<String, Object> header) {
        _header = header
        return this
    }

    def header(Closure headerClosure) {
        _headerClosure = headerClosure
        return this
    }

    def method(String method) {
        _method = method.toUpperCase()
        return this
    }

    def trace(boolean trace) {
        _trace = trace
        return this
    }
}
